import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import org.jdom.JDOMException;


public class CheatSheetBuilderTest {

	public static void main(String[] args) {
		String filename = args[0];
		ArrayList<XssAttack> xssPayloads = null;
		int counter =1;
		try {
			BufferedWriter bw = new BufferedWriter(new FileWriter("xssVectors.txt"));
			CheatSheetBuilder csb = new CheatSheetBuilder(filename);
			xssPayloads = csb.getXssPayloads();
			for (XssAttack xa : xssPayloads){
				//bw.write(counter+ "\r\n" + xa.getDesc());
				bw.write(xa.getPayload()+ "\r\n");
				counter+=1;
			}
			bw.write("\r\nThere are " + (counter-1) + " paylaods");
			bw.close();
		} catch (JDOMException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		

	}

}
